package com.qfmy.webapp.controller.agent;



import com.qfmy.common.result.Result;
import com.qfmy.webapp.service.agent.ChatService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author 清风明月
 * @Package com.qfmy.controller
 * @date 2025/11/15
 * @description 智能助手
 */
@Slf4j
@RestController
@SuppressWarnings("all")
@RequestMapping("/app/chat")
public class ChatController {

    /**
     * 注入service
     */
    @Resource
    private ChatService chatService;


    /**
     * 小说客服
     */
    @RequestMapping("/novelService")
    public Result novelService(@RequestParam String content){
        String text = chatService.FindNovelService(content);
        return Result.ok(text);
    }

    /**
     * 调用阿里的tts获取语音
     */
    @RequestMapping("/tts")
    public Result tts(@RequestParam String text){
        String url = chatService.tts(text);
        return Result.ok(url);
    }


}
